<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/9/7
  Time: 10:46
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <%
        request.setCharacterEncoding("UTF-8");
        String name=request.getParameter("userName");
        String pwd=request.getParameter("pwd");

        if (name.equals("name")&&pwd.equals("123")){
            Cookie cookie=new Cookie("cookie",name);
            cookie.setMaxAge(5);
            response.addCookie(cookie);
            response.sendRedirect("getCokie.jsp");
        }
    %>
</body>
</html>
